// 可在框架dom bom加载前设置浏览器的某些参数

//添加navigation的插件参数plugins
//catvm.memory.Plugin.new({description:"npAlisSOLogin Plugin",filename:"lnpalissologin.dll" ,name:"AlissOLogin plugin",MimeTypes:[{description: "AliSSOLogin " ,suffixes: "AlisSOLogin" ,type: "application/npalissologin." },{description: "AlissoLogin1" ,suffixes: "AlissoLogin" ,type: "application1/npalissologin"}]})
catvm.AddPlugin = function (data) {
    if (catvm.memory.PluginArray.temp === undefined) {
        catvm.memory.PluginArray.temp = []
    }
    catvm.memory.PluginArray.temp.push(data)
}
//api  删除数组中指定元素
Array.prototype.remove = function (val) {
    var index = this.indexOf(val);
    if (index > -1) {
        this.splice(index, 1);
    }
};
// js实现 解析单行元素
catvm.str_dom = function (val) {
    var shuxin = val.toString().split(">")
    var name = (shuxin[0] + "").split(" ")[0].replace("<", "")
    var name_first = (shuxin[0] + "").split(" ")[0] + "/>"
    var inte = val.slice(val.indexOf('>') + 1, val.indexOf(name_first) - name_first.length + 1)
    var shuxin_1 = (shuxin[0] + "").split(" ").slice(1, (shuxin[0] + "").split(" ").length)
    var shuxin_2 = {
        innerHTML: inte
    }
    for (let i = 0; i < shuxin_1.length; i++) {
        console.log(shuxin_1)
        shuxin_2[shuxin_1[i].split("=")[0]] = shuxin_1[i].split('=')[1].replace('"', "").replace('"', "")
        if (shuxin_1[i].split("=")[0] === "href") {
            shuxin_2["href"] = location.origin + shuxin_2["href"]
        }
    }
    return [name,shuxin_2]
}
